package demo02FactoryPattern.factory02;

/**
 * @author: WangPeng
 * @createTime: 2022/11/08 14:28
 * @description:
 * @version: v1.0
 */
public class Test01 {
    public static void main(String[] args) {
        //当我们需要产品是，创建相应产品工厂的对象，在调用其中的创建产品的方法
        //当有新的产品需求时只需要创建新的具体产品类和新的具体的产品工厂类，并分别继承抽象的产品类和抽象的工厂类
        Iphone13Factory iphone13Factory = new Iphone13Factory();
        Iphone iphone13 = iphone13Factory.createIphone();
        iphone13.look();

        Iphone14Factory iphone14Factory = new Iphone14Factory();
        Iphone iphone14 = iphone14Factory.createIphone();
        iphone14.look();

        Iphone15Factory iphone15Factory = new Iphone15Factory();
        Iphone iphone15 = iphone15Factory.createIphone();
        iphone15.look();


    }
}
